<template>
  <div class="explore-section">
    <h2 class="section-title">{{ jobTitle }}</h2>
    <div class="list-page-item">
      <div class="list-page-item-wrap">
        <ul>
          <li
            @click="drawer = true"
            v-for="jobImgItem in jobImgList"
            :key="jobImgItem.id"
          >
            <a>
              <div class="cover-wrap">
                <img :src="jobImgItem.imgUrl" alt="" />
              </div>
              <p class="card-title">{{ jobImgItem.name }}</p>
            </a>
          </li>
        </ul>
      </div>
    </div>
    <el-drawer
      class="drawerContent"
      :visible.sync="drawer"
      :with-header="false"
      :modal="false"
      size="500px"
    >
      <div>
        <span class="iconfont icon-cuocha_kuai" @click="close"></span>
        <iframe
          v-for="iframe in iframeList"
          :key="iframe.id"
          style="height: calc((100vh + 12px))"
          :src="iframe.src"
          frameborder="0"
        ></iframe>
      </div>
    </el-drawer>
  </div>
</template>

<script>
export default {
  name: 'MyJob',
  props: {
    jobImgList: {
      id: Number,
      name: String,
      imgUrl: String,
    },
    jobTitle: {
      type: String,
    },
  },
  data() {
    return {
      drawer: false,
      iframeList: [
        {
          id: 1,
          src: 'https://m.zhipin.com/activity/html/developer?activityId=7fa64281f360e90f1ndz2Q~~&source=wiki',
        },
        {
          id: 2,
          src: 'https://m.zhipin.com/activity/html/developer?activityId=9cedec95f753e9091nZ83g~~&source=wiki',
        },
        {
          id: 3,
          src: 'https://m.zhipin.com/activity/html/developer?activityId=885f705640bc0c361nR82A~~&source=wiki',
        },
        {
          id: 4,
          src: 'https://m.zhipin.com/activity/html/developer?activityId=c3a2a28c4f6e64821nR-2w~~&source=wiki',
        },
      ],
    }
  },
  methods: {
    close() {
      this.drawer = false
    },
  },
}
</script>

<style lang="less" scoped>
.section-title {
  margin-bottom: 24px;
}
.explore-section {
  width: 1200px;
  height: 300px;
  margin: 25px auto;
  margin-bottom: 0;
  padding: 24px 24px 34px;
  background-color: #fff;
  box-sizing: border-box;
  border-radius: 8px;
  margin-bottom: 25px;
}
.cover-wrap {
  width: 270px;
  height: 152px;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease-in-out;
  img {
    width: 270px;
    transition: all 0.2s ease-in-out;
  }
}
.cover-wrap img:hover {
  transform: scale(1.1, 1.1);
  transition: all 0.2s ease-in-out;
}
.card-title {
  margin: 14px 0 0;
  font-size: 16px;
  color: #12141a;
}
.list-page-item-wrap {
  ul {
    display: flex;
    li {
      width: 270px;
      margin-right: 24px;
    }
  }
}
iframe {
  width: 100%;
}
.icon-cuocha_kuai {
  position: absolute;
  cursor: pointer;
  right: 0;
  width: 30px;
  height: 30px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 0 0 0 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
</style>
